package com.guigu.www.cxk.service.imp;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guigu.www.cxk.service.CXKBespeakSetMealService;
import com.guigu.www.mapper.BespeakSetMealMapper;
import com.guigu.www.pojo.BespeakSetMeal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CXKBespeakSetMealServiceImpl implements CXKBespeakSetMealService {
    @Autowired
    BespeakSetMealMapper bespeakSetMealMapper;

    /*根据体检类型的id查询对应的套餐*/
    @Override
    public List<BespeakSetMeal> ProBespeakSetMeal(int id) {
        QueryWrapper<BespeakSetMeal> wrapper = new QueryWrapper<>();
        wrapper.eq("bes_type_id",id);
        return bespeakSetMealMapper.selectList(wrapper);
    }

    /*根据套餐id查询对应套餐表的信息*/
    @Override
    public BespeakSetMeal SelectByIdSetMeal(int id) {
        QueryWrapper<BespeakSetMeal> wrapper = new QueryWrapper<>();
        wrapper.eq("bes_sm_id",id);
        return bespeakSetMealMapper.selectOne(wrapper);
    }

    @Override
    public List<BespeakSetMeal> SelectByIdBespeak(int sid) {
        return bespeakSetMealMapper.SelectByIdBespeak(sid);
    }
}
